package assign1;
/* COMP 3760 - Algorithm Analysis and Design
 * Assignment #1 - Mnemonic Monkey
 * Stacy Mitchell	A00816991
 * Vukasin Simic	A00801474
 * 
 * October 14, 2012
 * 
 * Subset.java
 * 
 * Subset is a record of a combination of labs that can be visited in a single trip, the amount of MemoryRequired for the trip,
 * and the fastest possible ordering of the labs.
 */

import java.util.Comparator;
import java.util.List;

public class Subset {
	
	private List<Integer> list; //the Subset represented as a List
	private int memory_required; //Total memory from all labs in a set
	private List<Integer> best_permutation; //Fastest lab arrangement
	private double best_time; //Time of fastest arrangement
	
	//Constructor takes in the List representing the subset and the corresponding amount of Memory space(in MB) required by the labs
	public Subset(List<Integer> list, int memory_required) {
		super();
		this.list = list;
		this.memory_required = memory_required;
	}
	
	//Comparator used to sort Subset objects by the amount of Data(in MB) to be picked up in the trip
	public static Comparator<Subset> MemoryComparator 
    = new Comparator<Subset>() {
		public int compare(Subset set1, Subset set2) {
		    int memory1 = set1.getMemory_required();
		    int memory2 = set2.getMemory_required();
			//Sort paths in descending order
			return (memory2 > memory1)? 1 :(memory2 == memory1) ? 0 : -1;
		}
	};
	
	public List<Integer> getBest_permutation() {
		return best_permutation;
	}
	public void setBest_permutation(List<Integer> best_permutation) {
		this.best_permutation = best_permutation;
	}

	public double getBest_time() {
		return best_time;
	}
	public void setBest_time(double best_time) {
		this.best_time = best_time;
	}

	public int getMemory_required() {
		return memory_required;
	}
	public void setMemory_required(int memory_required) {
		this.memory_required = memory_required;
	}

	public List<Integer> getList() {
		return list;
	}
	public void setList(List<Integer> list) {
		this.list = list;
	}
	
}
